package com.xxx.coll;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/22  10:10
 * @Copyright
 */
public class collectionDome {
    public static void main(String[] args) {
        ArrayList<Student> students = new ArrayList<>();
        students.add(new Student("小明kk",13));
        students.add(new Student("魔角jjj",14));
        students.add(new Student("柯南nnnn",15));
        Student student = Collections.max(students);
//        System.out.println(student.getName());
        Collections.sort(students,new comparatorBylenhthLmpl());
        Iterator<Student> iterator = students.iterator();
        while (iterator.hasNext()){
            Student next = iterator.next();
            System.out.println(next.getName());
        }

    }
}
